import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        children:[
            {
                path: '/map/index',
                name: 'mapIndex',
                component: function () {
                    return import('../views/map/MapIndex.vue')
                }
            },
            {
                path: '/home/index',
                name: 'homeIndex',
                component: function () {
                    return import('../views/home/HomeIndex.vue')
                }
            },
            {
                path: '/coupon/index',
                name: 'couponIndex',
                component: function () {
                    return import('../views/coupon/CouponIndex.vue')
                }
            },
            {
                path: '/point/userpoint',
                name: 'userpoint',
                component: function () {
                    return import('../views/point/UserPoint.vue')
                }
            },
            {
                path: '/my/coupon/index',
                name: 'myCouponIndex',
                component: function () {
                    return import('../views/coupon/MyCouponIndex.vue')
                }
            },
            {
                path: '/mine/index',
                name: 'mineIndex',
                component: function () {
                    return import('../views/mine/MineIndex.vue')
                }
            },
            {
                path: '/code/index',
                name: 'codeIndex',
                component: function () {
                    return import('../views/code/ScanCodeIndex.vue')
                }
            },
            {path:'',redirect:'/home/index'}
        ]
    },
    {
        path: '/station/detail',
        name: 'stationDetail',
        component: function () {
            return import('../views/home/StationDetail.vue')
        }
    } ,
    {
        path: '/user/login',
        name: 'userLogin',
        component: function () {
            return import('../views/mine/UserLogin.vue')
        }
    },
    {
        path: '/user/registry',
        name: 'userRegistry',
        component: function () {
            return import('../views/mine/UserRegistry.vue')
        }
    },
    {
        path: '/user/charge/money',
        name: 'userChargeMoney',
        component: function () {
            return import('../views/mine/ChargeMoney.vue')
        }
    },
    {
        path: '/user/charge/ChargePayMoney',
        name: 'ChargePayMoney',
        component: function () {
            return import('../views/mine/ChargePayMoney.vue')
        }
    } ,



    {
        path: '/charging/start',
        name: 'chargingStart',
        component: function () {
            return import('../views/code/ChargingStart.vue')
        }
    },{
        path: '/charging/starting',
        name: 'chargingStarting',
        component: function () {
            return import('../views/code/ChargingStarting.vue')
        }
    },{
        path: '/charging/finish',
        name: 'chargingFinish',
        component: function () {
            return import('../views/code/ChargingFinish.vue')
        }
    },
    {
        path: '/user/charge/money/doing',
        name: 'chargeMoneyDoing',
        component: function () {
            return import('../views/mine/ChargeMoneyDoing.vue')
        }
    },
    {
        path: '/user/charge/pay/doing',
        name: 'ChargePayDoing',
        component: function () {
            return import('../views/mine/ChargePayDoing.vue')
        }
    },
    {
        path: '/user/charge/money/success',
        name: 'chargeMoneySuccess',
        component: function () {
            return import('../views/mine/ChargeMoneySuccess.vue')
        }
    },
    {
        path: '/user/charge/pay/paysuccess',
        name: 'CharPaySuccess',
        component: function () {
            return import('../views/mine/CharPaySuccess.vue')
        }
    },
    {
        path: '/user/charge/money/failed',
        name: 'chargeMoneyFailed',
        component: function () {
            return import('../views/mine/ChargeMoneyFailed.vue')
        }
    },
    {
        path: '/user/charging/order',
        name: 'chargingOrder',
        component: function () {
            return import('../views/order/ChargingOrder.vue')
        }
    },
    {
        path: '/my/invite',
        name: 'myInvite',
        component: function () {
            return import('../views/invite/MyInvite.vue')
        }
    },
    {
        path: '/user/pay/order',
        name: 'payOrder',
        component: function () {
            return import('../views/order/PayOrder.vue')
        }
    },
    {
        path: '/income/myIncome',
        name: 'MyIncome',
        component: function () {
            return import('../views/income/MyIncome.vue')
        }
    },
    {
        path: '/user/userinfo',
        name: 'userinfo',
        component: function () {
            return import('../views/mine/ChargeUserInfo.vue')
        }
    },
    {
        path: '/zhuanpan/dazhuanpan',
        name: 'dazhuanpan',
        component: function () {
            return import('../views/zhuanpan/dazhuanpan.vue')
        }
    },
    {
        path: '/user/points/history/change',
        name: 'points',
        component: function () {
            return import('../views/mine/UserPointsHistoryChange.vue')
        }
    },
    {
        path: '/cars/MyCars',
        name: 'MyCars',
        component: function () {
            return import('../views/cars/MyCars.vue')
        }
    },
    {
        path: '/user/charging/order',
        name: 'chargingOrder',
        component: function () {
            return import('../views/order/ChargingOrder.vue')
        }
    },
    {
        path: '/my/invite',
        name: 'myInvite',
        component: function () {
            return import('../views/invite/MyInvite.vue')
        }
    },
    {
        path: '/user/pay/order',
        name: 'payOrder',
        component: function () {
            return import('../views/order/PayOrder.vue')
        }
    },
    {
        path: '/income/myIncome',
        name: 'MyIncome',
        component: function () {
            return import('../views/income/MyIncome.vue')
        }
    },
    {
        path: '/user/userinfo',
        name: 'userinfo',
        component: function () {
            return import('../views/mine/ChargeUserInfo.vue')
        }
    },
    {
        path: '/user/points/history/change',
        name: 'points',
        component: function () {
            return import('../views/mine/UserPointsHistoryChange.vue')
        }
    },
    {
        path: '/cars/MyCars',
        name: 'MyCars',
        component: function () {
            return import('../views/cars/MyCars.vue')
        }
    }, {
        path: '/my/user/toupload',
        name: 'userToupload',
        component: function () {
            return import('../views/yonghuyichang/yichang.vue')
        }
    },
    {
        path: '/my/rechargeOrder',
        name: 'rechargeOrder',
        component: function () {
            return import('../views/mine/RechargeOrder.vue')
        }
    },
    {
        path: '/my/station',
        name: 'myStation',
        component: function () {
            return import('../views/station/MyStation.vue')
        }
    },
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
